import { Base_model } from '../../util/base_model.js';

class Index_model extends Base_model {
    constructor() {
      super();
    }

    //获取banner信息
    getBanner(callback) {
      var params = {
        url: '/banners/1',
        successCallback: function(res) {
          callback && callback(res);
        }
      };
      this.request(params);
    }

    //获取精选主题
    getTheme(callback) {
      var params = {
        url:'/themes?ids=1,2,3',
        successCallback: function(res) {
          callback && callback(res);
        }
      };
      this.request(params);
    }

    //获取最近新品
    getLatestProduct(callback) {
      var params = {
        url: '/products/latest?count=3',
        successCallback: function (res) {
          callback && callback(res);
        }
      };
      this.request(params);
    }

}

export {Index_model}